﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;

namespace UpdateBot2
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        /// <summary>
        /// For now it just throws it; however, we will later parse and bring to attention to user.
        /// </summary>
        /// <param name="err"></param>
        public static void ReportError(Exception err)
        {
            throw err;
        }

        private void Application_Startup(object sender, StartupEventArgs e)
        {
            UI.MainWindow mainWindow = new UI.MainWindow();
            this.MainWindow = mainWindow;

            //If argument is provided and a proper URL load main window!
            if (e.Args.Length > 0 && Uri.IsWellFormedUriString(e.Args[0], UriKind.Absolute))
            {
                mainWindow.StartUpURL = e.Args[0];
            }

            mainWindow.Show();
        }
    }
}
